package kr.co.goodwilldd;

import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.ModelAndView;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/root-context.xml",
		"/appServlet/servlet-context.xml" })
@WebAppConfiguration
public class SuperTestConfigurationNonSecutiry {

	@Autowired
	protected WebApplicationContext wac;

	protected MockMvc mockMvc;

	protected ModelAndView modelAndView;

	protected HandlerMethod handlerMethod;

	static {
		System.setProperty("spring.profiles.active", "test");
	}

	@Configuration
	@ComponentScan(basePackageClasses = SuperTestConfigurationNonSecutiry.class)
	static class Config {
	}

	@Before
	public void setup() {
		mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
	}
}
